package com.nd.our2project.service;


import com.nd.our2project.dao.UserDao;
import com.nd.our2project.pojo.LoginUser;
import com.nd.our2project.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserDao userDao;

    @Override
    public int addUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public List<User> queryAllUsers() {
        return userDao.queryAllUsers();
    }

    @Override
    public int queryUser(LoginUser loginUser) {
        return userDao.queryUser(loginUser);
    }

    @Override
    public String queryUserById(String job) {

        String email = userDao.queryUserById(job);
        return email;
    }

    @Override
    public User selectByEmail(String s) {
        return userDao.selectByEmail(s);
    }
}
